package com.physics.mps.module.param;

import com.physics.mps.common.util.LoginUtil;
import com.physics.mps.entity.vo.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author mcsoft
 * @date 2023/9/12 15:44
 * @description 参数 controller
 */
@Api(tags = "设置中心-参数设置")
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/param")
public class ParamController {


    private final ParamService paramService;


    @ApiOperation(value = "根据仿真软件与仿真模块，获取参数列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", name = "authorization", value = "authorization", dataType = "String", required = true),
            @ApiImplicitParam(paramType = "path", name = "appId", value = "仿真软件ID", dataType = "String", required = true),
            @ApiImplicitParam(paramType = "path", name = "moduleId", value = "仿真模块ID", dataType = "String", required = true),
    })
    @PostMapping("/selectAppParamTree/{appId}/{moduleId}")
    public ResponseResult selectAppParamTree(@PathVariable("appId") String appId, @PathVariable("moduleId") String moduleId) {
        return ResponseResult.success(paramService.selectAppParamTree(appId, moduleId, LoginUtil.getUserId()));
    }




}
